<html>
    <head>
        <script type="text/javascript">
            <?php
                if($this->id == ''){
                    ?>
                    common.setMainTitle('Add New Deal');
                    <?php
                }else{
                    ?>
                    common.setMainTitle('Edit User');
                    <?php
                }            
            ?>
        </script>
        <meta http-equiv = "Content-Type" content="text/html; charset=utf-8"/>
    </head>
    
    <body style="background-color: transparent">
        <form id="id-form" name="frm" method="post" action="/admin/deal/save" >
            <table>
                <tr>
                    <td nowarp='nowrap'> Name</td>
                    <td>
                        <input class="" id="name" name='NAME' value='<?=(isset($this->data->NAME) ? $this->data->NAME : '')?>' type="text" size="50" maxlength="75"/>
                    </td>
                </tr>
                
                <tr>
                    <td nowrap="nowrap">Store Name</td>
                    <td>
                        <select name="STOREID" id="STOREID" style="width:205px" value="0">
                            <option value="0">-- Chọn Store --</option>
                            <?php
                                $selected = "";
                                foreach($this->listStore as $store){
                                    if($store['STOREID'] == $this->data->STOREID){
                                        $selected = "selected=''";
                                    }else{
                                        $selected = "";
                                    }
                                    ?>
                                    <option <?=$selected?> value="<?=$store['STOREID']?>"><?=$store['NAME']?></option>
                                    <?php
                                }
                            ?>
                            
                        </select>
                    </td>
                </tr>
                
                <tr>
                    <td nowrap="nowrap"> Điều kiện sử dụng</td>
                    <td>
                        <textarea rows="5" cols="50"></textarea>
                    </td>
                </tr>
                
                <tr>
                    <td nowrap="nowrap">Mô tả chi tiết</td>
                    <td>
                        <textarea rows="5" cols="50"></textarea>
                    </td>
                </tr>
                
                <tr>
                    <td nowrap="nowrap">Số lượng phiếu phát hành</td>
                    <td>
                        <input type="text" value="" id=""/>
                    </td>
                </tr>
                
                <tr>
                    <td nowrap="nowrap">Deal bat dau luc</td>
                    <td>
                        <input type="text" value="" id=""/>
                    </td>
                </tr>
                
                <tr>
                    <td nowrap="nowrap">Keo dai trong</td>
                    <td>
                        <select name="day" id="">
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                        </select>
                    </td>
                </tr>
                
                <tr>
                    <td nowrap="nowrap" colspan="2">Một khách hàng có thể lấy mã phiếu và về sử dụng bao nhiêu lần</td>
                </tr>
                
                <tr>
                    <td>
                        <input type="radio" value="1" name="quanlity"/> 1 lan duy nhat
                    </td>
                    <td>
                        <input type="radio" value="1" name="quanlity"/> Nhieu lan
                    </td>
                </tr>
                
                <tr>
                    <td>
                        <input type="button" value="Cancel"/>
                        <input type="submit" value="Save"/>
                    </td>
                </tr>
            </table>
        </form>
    </body>
</html>